#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<vector>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,a,b) for(register int i = (a);i <= (b);++i)
#define per(i,a,b) for(register int i = (a);i >= (b);--i)  
typedef long long ll;
typedef unsigned long long ull;
using std::string;using std::cin;using std::cout;

//6,10,14
int x;

int main(){
	std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//freopen("in.in", "r", stdin);
	int _;
	cin >> _;
	while(_--){
		cin >> x;
		if(x <= 30) cout << "NO\n";
		else{
			cout << "YES\n";
			int tmp = x - 30;
			if(x == 36 || x == 40 || x == 44){
				cout << "15 10 6 " << x-31 << "\n";
			} else {
				cout << "14 10 6 " << x-30 << "\n";
			}
			
		}
	}

	return 0;
}